namespace hhg.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitialCreate1 : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.Tasks", "AssignedPerson_Id", "dbo.People");
            DropIndex("dbo.Tasks", new[] { "AssignedPerson_Id" });
            DropColumn("dbo.Tasks", "AssignedPersonId");
            RenameColumn(table: "dbo.Tasks", name: "AssignedPerson_Id", newName: "AssignedPersonId");
            DropPrimaryKey("dbo.People");
            AlterColumn("dbo.People", "Id", c => c.Int(nullable: false, identity: true));
            AlterColumn("dbo.Tasks", "AssignedPersonId", c => c.Int());
            AddPrimaryKey("dbo.People", "Id");
            CreateIndex("dbo.Tasks", "AssignedPersonId");
            AddForeignKey("dbo.Tasks", "AssignedPersonId", "dbo.People", "Id");
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.Tasks", "AssignedPersonId", "dbo.People");
            DropIndex("dbo.Tasks", new[] { "AssignedPersonId" });
            DropPrimaryKey("dbo.People");
            AlterColumn("dbo.Tasks", "AssignedPersonId", c => c.Long());
            AlterColumn("dbo.People", "Id", c => c.Long(nullable: false, identity: true));
            AddPrimaryKey("dbo.People", "Id");
            RenameColumn(table: "dbo.Tasks", name: "AssignedPersonId", newName: "AssignedPerson_Id");
            AddColumn("dbo.Tasks", "AssignedPersonId", c => c.Int());
            CreateIndex("dbo.Tasks", "AssignedPerson_Id");
            AddForeignKey("dbo.Tasks", "AssignedPerson_Id", "dbo.People", "Id");
        }
    }
}
